<%@ page language="java" contentType="text/html; charset=UTF-8"
import="it.polimi.swim.entity.SystemUser,java.util.List"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="myStyle.css">
<title>My Friends</title>
</head>
<body>
<div id='header' >
	<div style="float:left"><a href="homeUser.jsp">SWIMv2</a></div>
	<div style="float:right;"><a href="SignoutServlet">Sign out</a></div>
</div>
<div id="content">
<h4>My Friends</h4>
<%
List<SystemUser> friend = (List<SystemUser>)request.getAttribute("friends");

if(friend.size()>0){%>
	<table cellpadding="5" class="userInformations">
	<%
	for(SystemUser u: friend){ 
		if(session.getAttribute("id")==null || (Integer)session.getAttribute("id")!=u.getId()){%>
		<tr><td><div class="listUser">
				<div class="leftCell"><img src="img/user.jpg" width="60"/></div>
				<div class="rightCell">
					<%
					out.println("Name: "+u.getName()+"<br>");
					out.println("Surname: "+u.getSurname()+"<br>");
					out.println("City: "+u.getCity()+"<br>");
					}
					%>
				</div></div></td></tr>
			<%
			}		
		}%>
</table>
</body>
</html>